/*
 * @Author: boyyang
 * @Date: 2022-01-02 21:41:22
 * @LastEditTime: 2022-02-23 17:52:15
 * @LastEditors: boyyang
 * @Description: 正则校验
 * @FilePath: \boyyang\src\utils\regular.ts
 */

/**
 * @description: 邮箱正则校验
 * @param {string} email
 * @return {boolean}
 */
const emailReg = (email: string): boolean => {
    const emailR = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,})$/
    const isTrue = emailR.test(email)
    return isTrue
}

export {
    emailReg
}